import home from "@/views/DataPanel/Useranalysis.vue";
import layout from "@/views/layout/index.vue";

let routes = [
    {
        path: "/",
        name: "layout",
        redirect: "/login",
        component: layout,
        children: [
            {
                // 首页为数据面板
                path: "/home",
                name: "home",
                meta: {
                    hideInMenu: false,
                    title: "用户管理",
                    cache: true,
                    icon: "&#xe611;",
                    requiresAuth: true,
                },
                component: () => import("@/views/user/index.vue"),
            },
            // 数据面板路由
            {
                path: "/data-analysis",
                name: "data-analysis",
                meta: {
                    hideInMenu: false,
                    title: "数据面板",
                    cache: true,
                    icon: "&#xe7fc;",
                    requiresAuth: true,
                },
                children: [
                    {
                        path: "/user-data-analysis",
                        name: "user-data-analysis",
                        meta: {
                            hideInMenu: false,
                            title: "用户数据",
                            cache: true,
                            icon: "&#xe7c5;",
                            requiresAuth: true,
                        },
                        component: () => import("@/views/DataPanel/Useranalysis.vue"),
                    },
                    {
                        path: "/pets-data-analysis",
                        name: "pets-data-analysis",
                        meta: {
                            hideInMenu: false,
                            title: "宠物数据",
                            cache: true,
                            icon: "&#xe7c5;",
                            requiresAuth: true,
                        },
                        component: () => import("@/views/DataPanel/Petsanalysis.vue"),
                    },
                    {
                        path: "/platform-data-analysis",
                        name: "platform-data-analysis",
                        meta: {
                            hideInMenu: false,
                            title: "平台数据",
                            cache: true,
                            icon: "&#xe7c5;",
                            requiresAuth: true,
                        },
                        component: () => import("@/views/DataPanel/Platformanalysis.vue"),
                    },
                ],
            },

            {
                // 宠物管理
                path: "/pet-management",
                name: "pet-management",
                meta: {
                    hideInMenu: false,
                    title: "宠物管理",
                    cache: true,
                    icon: "&#xe611;",
                    requiresAuth: true,
                },
                children: [
                    {
                        path: "/pet-list",
                        name: "pet-list",
                        meta: {
                            hideInMenu: false,
                            title: "宠物列表",
                            cache: true,
                            icon: "&#xe7c5;",
                            requiresAuth: true,
                        },
                        component: () => import("@/views/petManage/petList.vue"),
                    },
                    {
                        path: "/pet-post",
                        name: "pet-post",
                        meta: {
                            hideInMenu: false,
                            title: "发布宠物",
                            cache: true,
                            icon: "&#xe7c5;",
                            requiresAuth: true,
                        },
                        component: () => import("@/views/petManage/petPost.vue"),
                    },
                ],
            },
            {
                // 订单管理
                path: "/order-management",
                name: "order-management",
                meta: {
                    hideInMenu: false,
                    title: "领养管理",
                    cache: true,
                    icon: "&#xe611;",
                    requiresAuth: true,
                },
                children: [
                    {
                        path: "/order-management-allList",
                        name: "order-management-allList",
                        meta: {
                            hideInMenu: false,
                            title: "所有领养信息",
                            cache: true,
                            icon: "&#xe7c5;",
                            requiresAuth: true,
                        },
                        component: () => import("@/views/orderManage/allOrderList.vue"),
                    },
                    {
                        path: "/order-management-adminList",
                        name: "order-management-adminList",
                        meta: {
                            hideInMenu: false,
                            title: "领养审核",
                            cache: true,
                            icon: "&#xe7c5;",
                            requiresAuth: true,
                        },
                        component: () => import("@/views/orderManage/adminOrderList.vue"),
                    },
                    {
                        path: "/order-management-dispute-order",
                        name: "order-management-dispute-order",
                        meta: {
                            hideInMenu: false,
                            title: "争议订单",
                            cache: true,
                            icon: "&#xe7c5;",
                            requiresAuth: true,
                        },
                        component: () => import("@/views/orderManage/disputeOrder.vue"),
                    },
                ],
            },
            {
                // 社区管理
                path: "/community-management",
                name: "community-management",
                meta: {
                    hideInMenu: false,
                    title: "社区管理",
                    cache: true,
                    icon: "&#xe611;",
                    requiresAuth: true,
                },
                children: [
                    {
                        path: "/community-management-topics",
                        name: "community-management-topics",
                        meta: {
                            hideInMenu: false,
                            title: "专题管理",
                            cache: true,
                            icon: "&#xe7c5;",
                            requiresAuth: true,
                        },
                        component: () => import("@/views/communityManage/topics.vue"),
                    },
                    {
                        path: "/article/:topicId",
                        name: "article",
                        meta: {
                            hideInMenu: true,
                            title: "文章管理",
                            cache: true,
                            icon: "&#xe7c5;",
                            requiresAuth: true,
                        },
                        component: () => import("@/views/communityManage/article.vue"),
                    },
                ],
            },
        ],
    },
    {
        path: "/login",
        name: "login",
        component: () => import("@/views/login/index.vue"),
        meta: {},
    },
];

export default routes;
